Azure Web PubSub Service REST API (stable:2024-12-01)

2025/08/19 • 25 new methods

GetServiceStatus (new)
Description Get service health status.
Reference Link ¶

⚼ Request

HEAD:  /api/health
{
api-version: string ,
}

⚐ Response (204)

{}

⚐ Response (default)

{
$headers:
{
x-ms-error-code: string ,
}
,
$schema:
{
error:
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
innererror:
{
code: string ,
innererror: string ,
}
,
}
,
}
,
}
AddConnectionsToGroups (new)
Description Add filtered connections to multiple groups.
Reference Link ¶

⚼ Request

POST:  /api/hubs/{hub}/:addToGroups
{
api-version: string ,
hub: string ,
groupsToAdd:
{
groups:
[
string ,
]
,
filter: string ,
}
,
}

⚐ Response (204)

{}

⚐ Response (default)

{
$headers:
{
x-ms-error-code: string ,
}
,
$schema:
{
error:
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
innererror:
{
code: string ,
innererror: string ,
}
,
}
,
}
,
}
CloseAllConnections (new)
Description Close the connections in the hub.
Reference Link ¶

⚼ Request

POST:  /api/hubs/{hub}/:closeConnections
{
api-version: string ,
hub: string ,
excluded: array ,
reason: string ,
}

⚐ Response (204)

{}

⚐ Response (default)

{
$headers:
{
x-ms-error-code: string ,
}
,
$schema:
{
error:
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
innererror:
{
code: string ,
innererror: string ,
}
,
}
,
}
,
}
GenerateClientToken (new)
Description Generate token for the client to connect Azure Web PubSub service.
Reference Link ¶

⚼ Request

POST:  /api/hubs/{hub}/:generateToken
{
api-version: string ,
hub: string ,
userId: string ,
roles: array ,
minutesToExpire: integer ,
groups: array ,
clientProtocol: string ,
}

⚐ Response (200)

{
token: string ,
}

⚐ Response (default)

{
$headers:
{
x-ms-error-code: string ,
}
,
$schema:
{
error:
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
innererror:
{
code: string ,
innererror: string ,
}
,
}
,
}
,
}
RemoveConnectionsFromGroups (new)
Description Remove filtered connections from multiple groups.
Reference Link ¶

⚼ Request

POST:  /api/hubs/{hub}/:removeFromGroups
{
api-version: string ,
hub: string ,
groupsToRemove:
{
groups:
[
string ,
]
,
filter: string ,
}
,
}

⚐ Response (204)

{}

⚐ Response (default)

{
$headers:
{
x-ms-error-code: string ,
}
,
$schema:
{
error:
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
innererror:
{
code: string ,
innererror: string ,
}
,
}
,
}
,
}
SendToAll (new)
Description Broadcast content inside request body to all the connected client connections.
Reference Link ¶

⚼ Request

POST:  /api/hubs/{hub}/:send
{
api-version: string ,
hub: string ,
excluded: array ,
filter: string ,
messageTtlSeconds: integer ,
message: string ,
}

⚐ Response (204)

{}

⚐ Response (default)

{
$headers:
{
x-ms-error-code: string ,
}
,
$schema:
{
error:
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
innererror:
{
code: string ,
innererror: string ,
}
,
}
,
}
,
}
CloseConnection (new)
Description Close the client connection.
Reference Link ¶

⚼ Request

DELETE:  /api/hubs/{hub}/connections/{connectionId}
{
api-version: string ,
hub: string ,
connectionId: string ,
reason: string ,
}

⚐ Response (204)

{}

⚐ Response (default)

{
$headers:
{
x-ms-error-code: string ,
}
,
$schema:
{
error:
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
innererror:
{
code: string ,
innererror: string ,
}
,
}
,
}
,
}
ConnectionExists (new)
Description Check if the connection with the given connectionId exists.
Reference Link ¶

⚼ Request

HEAD:  /api/hubs/{hub}/connections/{connectionId}
{
api-version: string ,
hub: string ,
connectionId: string ,
}

⚐ Response (200)

{}

⚐ Response (404)

{}

⚐ Response (default)

{
$headers:
{
x-ms-error-code: string ,
}
,
$schema:
{
error:
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
innererror:
{
code: string ,
innererror: string ,
}
,
}
,
}
,
}
SendToConnection (new)
Description Send content inside request body to the specific connection.
Reference Link ¶

⚼ Request

POST:  /api/hubs/{hub}/connections/{connectionId}/:send
{
api-version: string ,
hub: string ,
connectionId: string ,
messageTtlSeconds: integer ,
message: string ,
}

⚐ Response (204)

{}

⚐ Response (default)

{
$headers:
{
x-ms-error-code: string ,
}
,
$schema:
{
error:
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
innererror:
{
code: string ,
innererror: string ,
}
,
}
,
}
,
}
RemoveConnectionFromAllGroups (new)
Description Remove a connection from all groups.
Reference Link ¶

⚼ Request

DELETE:  /api/hubs/{hub}/connections/{connectionId}/groups
{
api-version: string ,
hub: string ,
connectionId: string ,
}

⚐ Response (204)

{}

⚐ Response (default)

{
$headers:
{
x-ms-error-code: string ,
}
,
$schema:
{
error:
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
innererror:
{
code: string ,
innererror: string ,
}
,
}
,
}
,
}
GroupExists (new)
Description Check if there are any client connections inside the given group
Reference Link ¶

⚼ Request

HEAD:  /api/hubs/{hub}/groups/{group}
{
api-version: string ,
hub: string ,
group: string ,
}

⚐ Response (200)

{}

⚐ Response (404)

{}

⚐ Response (default)

{
$headers:
{
x-ms-error-code: string ,
}
,
$schema:
{
error:
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
innererror:
{
code: string ,
innererror: string ,
}
,
}
,
}
,
}
CloseGroupConnections (new)
Description Close connections in the specific group.
Reference Link ¶

⚼ Request

POST:  /api/hubs/{hub}/groups/{group}/:closeConnections
{
api-version: string ,
hub: string ,
group: string ,
excluded: array ,
reason: string ,
}

⚐ Response (204)

{}

⚐ Response (default)

{
$headers:
{
x-ms-error-code: string ,
}
,
$schema:
{
error:
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
innererror:
{
code: string ,
innererror: string ,
}
,
}
,
}
,
}
SendToGroup (new)
Description Send content inside request body to a group of connections.
Reference Link ¶

⚼ Request

POST:  /api/hubs/{hub}/groups/{group}/:send
{
api-version: string ,
hub: string ,
group: string ,
excluded: array ,
filter: string ,
messageTtlSeconds: integer ,
message: string ,
}

⚐ Response (204)

{}

⚐ Response (default)

{
$headers:
{
x-ms-error-code: string ,
}
,
$schema:
{
error:
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
innererror:
{
code: string ,
innererror: string ,
}
,
}
,
}
,
}
ListConnectionsInGroup (new)
Description List connections in a group.
Reference Link ¶

⚼ Request

GET:  /api/hubs/{hub}/groups/{group}/connections
{
api-version: string ,
hub: string ,
group: string ,
maxpagesize: integer ,
top: integer ,
continuationToken: string ,
}

⚐ Response (200)

{
value:
[
{
connectionId: string ,
userId: string ,
}
,
]
,
nextLink: string ,
}

⚐ Response (default)

{
$headers:
{
x-ms-error-code: string ,
}
,
$schema:
{
error:
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
innererror:
{
code: string ,
innererror: string ,
}
,
}
,
}
,
}
AddConnectionToGroup (new)
Description Add a connection to the target group.
Reference Link ¶

⚼ Request

PUT:  /api/hubs/{hub}/groups/{group}/connections/{connectionId}
{
api-version: string ,
hub: string ,
group: string ,
connectionId: string ,
}

⚐ Response (200)

{}

⚐ Response (default)

{
$headers:
{
x-ms-error-code: string ,
}
,
$schema:
{
error:
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
innererror:
{
code: string ,
innererror: string ,
}
,
}
,
}
,
}
RemoveConnectionFromGroup (new)
Description Remove a connection from the target group.
Reference Link ¶

⚼ Request

DELETE:  /api/hubs/{hub}/groups/{group}/connections/{connectionId}
{
api-version: string ,
hub: string ,
group: string ,
connectionId: string ,
}

⚐ Response (204)

{}

⚐ Response (default)

{
$headers:
{
x-ms-error-code: string ,
}
,
$schema:
{
error:
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
innererror:
{
code: string ,
innererror: string ,
}
,
}
,
}
,
}
GrantPermission (new)
Description Grant permission to the connection.
Reference Link ¶

⚼ Request

PUT:  /api/hubs/{hub}/permissions/{permission}/connections/{connectionId}
{
api-version: string ,
hub: string ,
permission: string ,
connectionId: string ,
targetName: string ,
}

⚐ Response (200)

{}

⚐ Response (default)

{
$headers:
{
x-ms-error-code: string ,
}
,
$schema:
{
error:
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
innererror:
{
code: string ,
innererror: string ,
}
,
}
,
}
,
}
RevokePermission (new)
Description Revoke permission for the connection.
Reference Link ¶

⚼ Request

DELETE:  /api/hubs/{hub}/permissions/{permission}/connections/{connectionId}
{
api-version: string ,
hub: string ,
permission: string ,
connectionId: string ,
targetName: string ,
}

⚐ Response (204)

{}

⚐ Response (default)

{
$headers:
{
x-ms-error-code: string ,
}
,
$schema:
{
error:
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
innererror:
{
code: string ,
innererror: string ,
}
,
}
,
}
,
}
CheckPermission (new)
Description Check if a connection has permission to the specified action.
Reference Link ¶

⚼ Request

HEAD:  /api/hubs/{hub}/permissions/{permission}/connections/{connectionId}
{
api-version: string ,
hub: string ,
permission: string ,
connectionId: string ,
targetName: string ,
}

⚐ Response (200)

{}

⚐ Response (404)

{}

⚐ Response (default)

{
$headers:
{
x-ms-error-code: string ,
}
,
$schema:
{
error:
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
innererror:
{
code: string ,
innererror: string ,
}
,
}
,
}
,
}
UserExists (new)
Description Check if there are any client connections connected for the given user.
Reference Link ¶

⚼ Request

HEAD:  /api/hubs/{hub}/users/{userId}
{
api-version: string ,
hub: string ,
userId: string ,
}

⚐ Response (200)

{}

⚐ Response (404)

{}

⚐ Response (default)

{
$headers:
{
x-ms-error-code: string ,
}
,
$schema:
{
error:
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
innererror:
{
code: string ,
innererror: string ,
}
,
}
,
}
,
}
CloseUserConnections (new)
Description Close connections for the specific user.
Reference Link ¶

⚼ Request

POST:  /api/hubs/{hub}/users/{userId}/:closeConnections
{
api-version: string ,
hub: string ,
userId: string ,
excluded: array ,
reason: string ,
}

⚐ Response (204)

{}

⚐ Response (default)

{
$headers:
{
x-ms-error-code: string ,
}
,
$schema:
{
error:
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
innererror:
{
code: string ,
innererror: string ,
}
,
}
,
}
,
}
SendToUser (new)
Description Send content inside request body to the specific user.
Reference Link ¶

⚼ Request

POST:  /api/hubs/{hub}/users/{userId}/:send
{
api-version: string ,
hub: string ,
userId: string ,
filter: string ,
messageTtlSeconds: integer ,
message: string ,
}

⚐ Response (204)

{}

⚐ Response (default)

{
$headers:
{
x-ms-error-code: string ,
}
,
$schema:
{
error:
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
innererror:
{
code: string ,
innererror: string ,
}
,
}
,
}
,
}
RemoveUserFromAllGroups (new)
Description Remove a user from all groups.
Reference Link ¶

⚼ Request

DELETE:  /api/hubs/{hub}/users/{userId}/groups
{
api-version: string ,
hub: string ,
userId: string ,
}

⚐ Response (204)

{}

⚐ Response (default)

{
$headers:
{
x-ms-error-code: string ,
}
,
$schema:
{
error:
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
innererror:
{
code: string ,
innererror: string ,
}
,
}
,
}
,
}
AddUserToGroup (new)
Description Add a user to the target group.
Reference Link ¶

⚼ Request

PUT:  /api/hubs/{hub}/users/{userId}/groups/{group}
{
api-version: string ,
hub: string ,
group: string ,
userId: string ,
}

⚐ Response (200)

{}

⚐ Response (default)

{
$headers:
{
x-ms-error-code: string ,
}
,
$schema:
{
error:
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
innererror:
{
code: string ,
innererror: string ,
}
,
}
,
}
,
}
RemoveUserFromGroup (new)
Description Remove a user from the target group.
Reference Link ¶

⚼ Request

DELETE:  /api/hubs/{hub}/users/{userId}/groups/{group}
{
api-version: string ,
hub: string ,
group: string ,
userId: string ,
}

⚐ Response (204)

{}

⚐ Response (default)

{
$headers:
{
x-ms-error-code: string ,
}
,
$schema:
{
error:
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
innererror:
{
code: string ,
innererror: string ,
}
,
}
,
}
,
}